package com.mjh.manager;

import java.util.List;
import org.apache.log4j.Logger;
import com.mjh.bean.Picture;
import com.mjh.comm.page.Pager;
import com.mjh.dao.PictureDAO;

public class PictureManager {

	public static Logger log = Logger.getLogger(PictureManager.class);
	
	private PictureDAO dao = new PictureDAO();
	
	public int addPicture(Picture picture){
		return dao.insert(picture);
	}
	
	public int delPicture(int id){
		return dao.delete(id);
	}

	public int delPictureForTrue(int id){
		return dao.deleteForTrue(id);
	}
	
	public Picture getPicture(int id){
		return dao.select(id);
	}
	
	public List<Picture> listByArticle(int category, Pager pager){
		return dao.selectByArticle(category, pager);
	}
	
	public List<Picture> listAll(Pager pager){
		return dao.selectAllByAdmin(pager);
	}
}
